<template>
  <input type="number" :value="value" @input="handleChange" />
</template>

<script setup lang="ts">
import { defineProps } from "vue";
import { FieldPropsDefine } from "../types";
const props = defineProps(FieldPropsDefine);
const handleChange = (e: any) => {
  console.log(e);
  const value = e.target.value;
  const num = Number(value);
  if (Number.isNaN(num)) {
    props.onChange(undefined);
  } else {
    props.onChange(num);
  }
};
</script>
